﻿Imports extremo
Public Class BProveedor

    
    Private Sub btnBuscar_Click(sender As System.Object, e As System.EventArgs) Handles btnBuscar.Click
        Dim criterio As String = Me.txtBuscar.Text
        'MsgBox(criterio)

        Dim negocio As New ProveedorNegocio
        Dim categorias As Collection = negocio.buscarPorNombre(criterio)
        Me.dgvCategorias.DataSource = categorias
        Me.dgvCategorias.EditMode = False

        Me.dgvCategorias.Columns(0).HeaderText = "IdProveedor"
        Me.dgvCategorias.Columns(1).HeaderText = "Nombre"
        Me.dgvCategorias.Columns(2).HeaderText = "Ruc"
        Me.dgvCategorias.Columns(3).HeaderText = "Dirección"
        Me.dgvCategorias.Columns(4).HeaderText = "Teléfono"

    End Sub

    Private Sub BProveedor_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        With Me.dgvCategorias.ColumnHeadersDefaultCellStyle
            .BackColor = Color.Red
            .ForeColor = Color.White
        End With

    End Sub

    Private Sub btnEditar_Click(sender As System.Object, e As System.EventArgs) Handles btnEditar.Click

    End Sub

    Private Sub btnEliminar_Click(sender As System.Object, e As System.EventArgs) Handles btnEliminar.Click
        Dim seleccionado = Me.dgvCategorias.CurrentRow.Cells(0).Value.ToString
        Dim negocio As New ProveedorNegocio
        negocio.eliminar(seleccionado)
        dgvCategorias.DataSource = ""

    End Sub

    Private Sub btnCancelar_Click(sender As System.Object, e As System.EventArgs) Handles btnCancelar.Click

    End Sub
End Class